package com.dream.keigezhushou.Activity.kege.acty;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.dream.keigezhushou.Activity.Uiutils.StringUtils;
import com.dream.keigezhushou.Activity.acty.ksong.JoinChorusLrcActivity;
import com.dream.keigezhushou.Activity.kege.adapter.JoinChorusAdapter;
import com.dream.keigezhushou.R;
import com.handmark.pulltorefresh.library.PullToRefreshListView;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * 加入合唱
 */
public class JoinChorusActivity extends AppCompatActivity {
    @BindView(R.id.iv_return)
    ImageView ivReturn;
    @BindView(R.id.tv_title)
    TextView tvTitle;

    @BindView(R.id.list_lv)
    PullToRefreshListView mMPullToRefreshListView;
    private ListView mListlv;
    private JoinChorusAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_join_chorus);
        ButterKnife.bind(this);
        initView();
    }

    //初始化控件
    public void initView() {
        tvTitle.setText("加入合唱");
        mListlv = mMPullToRefreshListView.getRefreshableView();
        adapter = new JoinChorusAdapter(JoinChorusActivity.this);

        mListlv.setAdapter(adapter);

        adapter.setItemOnClickListening(new JoinChorusAdapter.ItemOnClickListening() {
            @Override
            public void itemClick(int postion) {
                Intent intent=new Intent();
                intent.putExtra(StringUtils.KEGESTATE,"加入合唱");
                intent.setClass(JoinChorusActivity.this,SingingDetailActivity.class);
                startActivity(intent);
            }

            @Override
            public void singingJoinClick(int postion) {
                Intent intent=new Intent();
                intent.putExtra(StringUtils.KEGESTATE,"加入合唱");
                intent.setClass(JoinChorusActivity.this,JoinChorusLrcActivity.class);
                startActivity(intent);


            }
        });

    }
}
